#
# Copyright (C) 2012-2013 Alfresco Software Limited.
#
# This file is part of Alfresco
#
# Alfresco is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Alfresco is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
#
# CMakeLists.txt for the Office Launcher Plug-In project
#

# Written to work with cmake 2.6
cmake_minimum_required (VERSION 2.6)
set (CMAKE_BACKWARDS_COMPATIBILITY 2.6)

Project(${PLUGIN_NAME})

file (GLOB GENERAL RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
    [^.]*.cpp
    [^.]*.h
    [^.]*.cmake
    [^.]*.html
    [^.]*.js
    )

include_directories(${PLUGIN_INCLUDE_DIRS} ${FB_SOURCE_DIR}/3rdParty/utf8)

# Generated files are stored in ${GENERATED} by the project configuration
SET_SOURCE_FILES_PROPERTIES(
    ${GENERATED}
    PROPERTIES
        GENERATED 1
    )

SOURCE_GROUP(Generated FILES
    ${GENERATED}
    )

SET( SOURCES
    ${GENERAL}
    ${GENERATED}
    )

# This will include Win/projectDef.cmake, X11/projectDef.cmake, Mac/projectDef
# depending on the platform
include_platform()

# include the platform dependant SchemaHandler project
include_external_msproject(
        "Office launcher Schema Handler"
        "${CMAKE_CURRENT_SOURCE_DIR}/Win/OfficeLauncherSchemaHandler/OfficeLauncherSchemaHandler.vcxproj")

#this will build a Chrome package
#add_chrome_package(${PLUGIN_NAME}
#        ${FB_BIN_DIR}/${PLUGIN_NAME}/${CMAKE_CFG_INTDIR}/
#        "${FB_BIN_DIR}/${PLUGIN_NAME}/${CMAKE_CFG_INTDIR}/${FBSTRING_PluginFileName}.dll"
#        "${CMAKE_CURRENT_SOURCE_DIR}/sign/package_key.pem"
#        ${PROJECT_NAME})

#this will build a XPI package using XPISigner (see http://code.google.com/p/xpisigner/ )
# add_signed_xpi_installer(${PLUGIN_NAME}
#         ${FB_BIN_DIR}/${PLUGIN_NAME}/${CMAKE_CFG_INTDIR}/
#   "${FB_BIN_DIR}/${PLUGIN_NAME}/${CMAKE_CFG_INTDIR}/${FBSTRING_PluginFileName}.dll"
#         $ENV{XPI_PATH}
#         "${CMAKE_CURRENT_SOURCE_DIR}/sign/certificate.pfx"
#         "${CMAKE_CURRENT_SOURCE_DIR}/sign/passphrase.txt"
#         ${PROJECT_NAME})